<template>
  <div class="container">
    <DataView
      ref="dvDictType"
      propViewKey="sys_dict_type"
      propViewForm="sys/dict-type/detail.vue"
      @before-load="beforeLoad"
      :propIsTdesign="true"
    />
  </div>
</template>

<script>
import DataView from '@/components/DataView.vue'

export default {
  name: 'dicttype',
  data() {
    return {}
  },
  components: {
    DataView,
  },
  mounted() {},
  methods: {
    beforeLoad() {
      // 通用参数-字典类型可编辑
      if (!this.parameters.dictEditConfigIsEnabled(this)) {
        this.$nextTick(() => {
          // 表格按钮隐藏
          this.$refs.dvDictType.setButtonInvisible('view', 'vb-add')
          this.$refs.dvDictType.setButtonInvisible('view', 'vb-delete')
          // 行按钮隐藏
          this.$refs.dvDictType.setButtonInvisible('row', 'vrb-edit')
          this.$refs.dvDictType.setButtonInvisible('row', 'vrb-delete')
          this.$refs.dvDictType.setButtonInvisible('row', 'vrb-view', false)
        })
      } else {
        this.$nextTick(() => {
          this.$refs.dvDictType.setButtonInvisible('row', 'vrb-view')
        })
      }
    },
  },
}
</script>

<style lang="scss" scoped>
.container {
  height: 100%;
  background-color: #fff;
}
</style>
